ComponentOne Data Source for Entity Framework
C1.LiveLinq Namespace / LiveViewExtensions Class / LiveMax Method / LiveMax<TSource,TResult>(View<TSource>,Expression<Func<TSource,TResult>>) Method
The type of the elements of source.
The type of the value returned by selector.
A view containing the values to determine the maximum value of.
A transform function to apply to each element.

In This Topic
    LiveMax<TSource,TResult>(View<TSource>,Expression<Func<TSource,TResult>>) Method
    In This Topic
    Invokes a transform function on each element of a view of elements of a generic type and computes the maximum resulting value.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function LiveMax
        (Of TSource,TResult)( _
       ByVal source As View(Of TSource), _
       ByVal selector As System.Linq.Expressions.Expression(Of Func(Of TSource,TResult)) _
    ) As AggregationView(Of TSource,TResult)
    public static AggregationView<TSource,TResult> LiveMax<TSource,TResult>( 
       View<TSource> source,
       System.Linq.Expressions.Expression<Func<TSource,TResult>> selector
    )

    Parameters

    source
    A view containing the values to determine the maximum value of.
    selector
    A transform function to apply to each element.

    Type Parameters

    TSource
    The type of the elements of source.
    TResult
    The type of the value returned by selector.

    Return Value

    A view representing the maximum of the values.
    Remarks

    If type TResult implements System.IComparable`1, this method uses that implementation to compare values. Otherwise, if type TResult implements System.IComparable, that implementation is used to compare values.

    It is possible to use standard LINQ query operator Max instead of LiveMax. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Max will every time loop through the entire source collection and aggregate it from scratch, whereas LiveMax will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.

    See Also